#include "vga.h"
#include "interrupt.h"
#include "tss.h"
#include "page.h"


extern int memory_size[];
/*kernel stack */
unsigned char kernel_stack[2048];
/*usr_stack size*/
extern unsigned char usr_stack[2*1024];

void task1(void)
{
    int i = 0;

    while(1){
        for(i = 0 ; i < 800000 ; i ++);
        //asm("mov $'b',%eax;int $0x80;");
    }
}

void task0(void)
{
    int i = 0;
    
    while(1){
        for(i = 0 ; i < 800000 ; i ++);
       // asm("mov $'a',%eax; int $0x80;");
    }
}

 
void main( void )
{    
     
    init_vga();

    setup_ldt();
    setup_tss();
    init_page();

    setup_interrupt();

    // push  0x17                         ;ss
    // push dword  my_task1_stack         ;esp
    // pushf                              ;eflags
    // push  0xf                          ;cs
    // push dword main                    ;eip
    //asm("pushl $0x17;pushl $(usr_stack+1024);pushfl;pushl $0xf;pushl $task0;iret;");
  
    memory_init();

    while (1)
    {

    }
     
}










